<?
if (!$_SESSION['sys_adminid']){
    
	echo "<script>top.location.href='login.php';</script>";exit();
}
//获取当前文件的名称
$curfilename=basename($_SERVER['SCRIPT_FILENAME']);
//看是否有执行权限
$sqlqz="select *  from {$db_prefix}sysfile where furl='$curfilename'";
$rsqz=$db->get_one($sqlqz);
if ($rsqz['id']){
	$glypower='';
	$sqlqx="select departid from {$db_prefix}admin888 where id='".$_SESSION['sys_adminid']."'";
	$rsqx=$db->get_one($sqlqx);
	if ($rsqx['departid']){
		$sqlpow="select power from {$db_prefix}departs where id='".$rsqx['departid']."'";
		$rspow=$db->get_one($sqlpow);
		$glypower=$rspow['power'];
		$glypowerary=explode(',',$glypower);
		if (!in_array($rsqz['id'],$glypowerary)){
			die("您没有权限");
		}
	}
}
?>
